<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>云南省工业互联网管理平台</title>
    <link rel="stylesheet" href="/front/css/base.css" />
    <link rel="stylesheet" href="/front/layui/css/layui.css" />
    <link rel="stylesheet" href="/front/css/bootstrap.css" />
    <link rel="stylesheet" href="/front/css/iconfont.css" />
    <link rel="stylesheet" href="/front/css/style.min.css" />
    <link rel="stylesheet" href="/front/css/enterprise/enterprise.css" />

    <script type="text/javascript" src="/front/js/jquery-3.3.1.min.js" ></script>
    <script src="/front/js/bootstrap.js"></script>
    <script src="/front/layui/layui.js" charset="utf-8"></script>
    <script src="/front/js/base.js" charset="utf-8"></script>
    <script src="/front/js/api.js" charset="utf-8"></script>
    <script src="/front/js/common.js" charset="utf-8"></script>
    <script src="/lib/serializeJSON.js" charset="utf-8"></script>
</head>
<body>
<div class="commonHead"></div>
<div class="container-fluid">
    <div class="clearfix">
        <div class="commonLeft"></div>
        <div class="myboxr">
            <div class="myboxr-in">
                <!--在此处实现页面布局-->
                <div class="title">
                    单位信息
                    <div class="title-right"><i class="red">*</i>号为必填项</div>
                </div>
                <hr>
                <form id="enterpriseBasicForm" class="layui-form">
                    <input type="hidden" name="entBasicId" id="entBasicId">
                    <input type="hidden" name="entId" id="entId">
                    <div class="layui-form-item">
                        <div class="layui-inline width-33">
                            <label class="layui-form-label">单位名称：</label>
                            <div class="layui-input-block">
                                <input type="text" name="entName" id="entName" autocomplete="off" class="layui-input layui-disabled" disabled placeholder="请输入单位名称">
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label">统一社会信用代码：</label>
                            <div class="layui-input-block">
                                <input type="text" name="entCode" id="entCode" autocomplete="off" class="layui-input layui-disabled" disabled placeholder="请输入统一社会信用代码">
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label">注册时间：</label>
                            <div class="layui-input-block">
                                <input type="text" name="registerTimeStr" id="registerTimeStr" autocomplete="off" class="layui-input layui-disabled" disabled placeholder="请输入注册时间">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-33">
                            <label class="layui-form-label">单位性质：</label>
                            <div class="layui-input-block">
                                <select name="entProperty" id="entProperty" disabled class="layui-disabled">
                                    <option value="">==请选择==</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label">法定代表人：</label>
                            <div class="layui-input-block">
                                <input type="text" name="legalPerson" id="legalPerson" autocomplete="off" class="layui-input layui-disabled" disabled placeholder="请输入法定代表人">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-100">
                            <label class="layui-form-label">注册地址：</label>
                            <div class="layui-input-block">
                                <input type="text" name="registerAddress" id="registerAddress" lay-verify="required" autocomplete="off" class="layui-input layui-disabled" disabled placeholder="请输入单位地址">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>登记注册类型：</label>
                            <div class="layui-input-block">
                                <select name="registrationType" id="registrationType" lay-verify="required">
                                    <option value="">==请选择==</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>控股情况：</label>
                            <div class="layui-input-block">
                                <select name="holdings" id="holdings" lay-verify="required">
                                    <option value="">==请选择==</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>规模以上企业：</label>
                            <div class="layui-input-block">
                                <select name="scale" id="scale" lay-verify="required">
                                    <option value="">==请选择==</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>上年主营业务收入(万元)：</label>
                            <div class="layui-input-block">
                                <input type="text" name="mainOperationIncome" id="mainOperationIncome" lay-verify="required" autocomplete="off" class="layui-input" placeholder="上年主营业务收入(万元)">
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>员工总数：</label>
                            <div class="layui-input-block">
                                <input type="text" name="currentEadcount" id="currentEadcount" lay-verify="required" autocomplete="off" class="layui-input" placeholder="员工总数">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>高新技术企业：</label>
                            <div class="layui-input-block">
                                <select name="highTech" id="highTech" lay-verify="required" lay-filter="highTech">
                                    <option value="">==请选择==</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline width-33" id="haveTime">
                            <label class="layui-form-label"><i class="red">*</i>获评时间：</label>
                            <div class="layui-input-block">
                                <input type="text" name="haveTimeStr" id="haveTimeStr" lay-verify="required" autocomplete="off" class="layui-input" placeholder="获评时间">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>企业技术中心：</label>
                            <div class="layui-input-block">
                                <select name="technologyCenter" id="technologyCenter" lay-verify="required">
                                    <option value="">==请选择==</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>级别：</label>
                            <div class="layui-input-block">
                                <select name="levels" id="levels" lay-verify="required">
                                    <option value="">==请选择==</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>州市：</label>
                            <div class="layui-input-block">
                                <select name="city" id="city" lay-verify="required">
                                    <option value="">==请选择==</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>企业总经理：</label>
                            <div class="layui-input-block">
                                <input type="text" name="generalManager" id="generalManager" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入企业总经理姓名">
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>电话：</label>
                            <div class="layui-input-block">
                                <input type="text" name="managerPhone" id="managerPhone" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入企业总经理电话">
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>E-mail：</label>
                            <div class="layui-input-block">
                                <input type="text" name="managerEmail" id="managerEmail" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入企业总经理Email">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>联系人：</label>
                            <div class="layui-input-block">
                                <input type="text" name="contactName" id="contactName" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入联系人姓名">
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>职务：</label>
                            <div class="layui-input-block">
                                <input type="text" name="contactDuty" id="contactDuty" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输联系人入职务">
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>电话：</label>
                            <div class="layui-input-block">
                                <input type="text" name="contactPhone" id="contactPhone" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入联系人电话">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>手机：</label>
                            <div class="layui-input-block">
                                <input type="text" name="contactMobilePhone" id="contactMobilePhone" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入联系人手机号码">
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>E-mail：</label>
                            <div class="layui-input-block">
                                <input type="text" name="contactEmail" id="contactEmail" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入联系人Email">
                            </div>
                        </div>
                        <div class="layui-inline width-33">
                            <label class="layui-form-label"><i class="red">*</i>微信号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="contactWechatId" id="contactWechatId" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入联系人微信号">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-100">
                            <label class="layui-form-label"><i class="red">*</i>通信地址：</label>
                            <div class="layui-input-block">
                                <input type="text" name="contactAddress" id="contactAddress" lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入通信地址">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline width-100">
                            <label class="layui-form-label"><i class="red">*</i>企业简介：</label>
                            <div class="layui-input-block">
                                <textarea type="text" name="profile" id="profile" lay-verify="required" maxlength="400" autocomplete="off" class="layui-textarea" placeholder="发展历程、主营业务、市场销售等方面基本情况，不超过400字"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item" style="margin-top: 5px">
                        <div class="layui-inline width-100">
                            <label class="layui-form-label"><i class="red">*</i>主要产品：</label>
                            <div class="layui-input-block">
                                <textarea type="text" name="majorProduct" id="majorProduct" lay-verify="required" autocomplete="off" class="layui-textarea" placeholder="请输入主要产品"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item" style="margin-top: 5px;text-align: center">
                        <button type="button" id="save"  lay-submit="" lay-filter="save" class="btn my-btn">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<div class="commonFooter"></div>
<script>
    var json = [];
    json.push({ "id": "registrationType", "code": "registrationType" });
    json.push({ "id": "entProperty", "code": "entProperty" });
    json.push({ "id": "holdings", "code": "holdings" });
    json.push({ "id": "scale", "code": "scale" });
    json.push({ "id": "highTech", "code": "highTech" });
    json.push({ "id": "technologyCenter", "code": "technologyCenter" });
    json.push({ "id": "levels", "code": "levels" });
    json.push({ "id": "city", "code": "city" });
    layuiReady(function () {
        //初始化时间控件
        laydate.render({
            elem: '#haveTimeStr',
            type: 'date'
        });
        //初始化下拉选择
        initMoreDic(json);
        //初始化数据
        dataView();

        _loadingClose();
        //监听事件
        layform.on('select(highTech)', function(data){
            if(data.value == 1){
                $("#haveTime").show();
                $("#haveTimeStr").attr("lay-verify","required");
            }else{
                $("#haveTime").hide();
                $("#haveTimeStr").removeAttr("lay-verify");
            }
        });
        layform.render();
        layform.on('submit(save)', function (data) {
            data = data.field;
            data.entBasicId = $("#entBasicId").val();
            noSubmitBtn('#save');
            This.jqueryAjax(Api.entInfo.addOrUpdate, data, "json", function (data) {
                if (data && data.status == 1) {
                    layer.msg(data.message, {icon: 6});
                    reSubmitBtn('#save');
                } else {
                    reSubmitBtn('#save');
                    layerMessageOk(data.message, 2);
                }
            });
        });


    });

    //初始化企业信息
    function dataView(){
        This.jqueryAjax(Api.entInfo.getEntInfo, {}, "json", function (data) {
            if (data && data.status == 1) {
                var dataObject = data.object;
                $("#entBasicId").val(dataObject.id);
                if(dataObject.entId){
                    $("#entId").val(dataObject.entId);
                }
                if(dataObject.highTech == 1){
                    $("#haveTime").show();
                } else {
                    $("#haveTime").hide();
                }
                if(dataObject.entProperty){
                    $("#entProperty").val(dataObject.entProperty);
                }
                if(dataObject.registrationType){
                    $("#registrationType").val(dataObject.registrationType);
                }
                if(dataObject.holdings){
                    $("#holdings").val(dataObject.holdings);
                }
                if(dataObject.scale){
                    $("#scale").val(dataObject.scale);
                }
                if(dataObject.highTech){
                    $("#highTech").val(dataObject.highTech);
                }
                if(dataObject.technologyCenter){
                    $("#technologyCenter").val(dataObject.technologyCenter);
                }
                if(dataObject.levels){
                    $("#levels").val(dataObject.levels);
                }
                if(dataObject.city){
                    $("#city").val(dataObject.city);
                }
                valData(dataObject);
            }
        });
    }
</script>
</body>
</html>